package org.dfg.corejava.designPattern.state;

public class StateA implements State {

	@Override
	public void handle(Context ctx) {
		if (ctx.getId() == 0) {
			System.out.println("状态0");
			ctx.setId(1);
			ctx.setState(new StateB());
		}else{
			System.out.println("非0");
			ctx.setId(2);
			ctx.setState(new StateC());
		}
	}
}
